//////////////////////////////////////////////////////////
// This class has been automatically generated on
// Fri Jan  7 14:13:45 2011 by ROOT version 5.24/00
// from TChain tree/
//////////////////////////////////////////////////////////

#ifndef dataselector_h
#define dataselector_h

//#include <iostream>
//#include <iomanip>
//#include <stdlib.h>
#include <TROOT.h>
#include <TChain.h>
#include <TFile.h>
#include <TSelector.h>
#include <TH1D.h>
#include <TMath.h>

TString getHistNameExt(int njet) {
    TString ht_ext = "_j";
    ht_ext += njet;
    return ht_ext;
}

class dataselector : public TSelector {
public :
   TTree          *fChain;   //!pointer to the analyzed TTree or TChain
   //TTree          *fChainSelect;

   TH1D *hTight[5]; //d0sig histogram of tight muons
   TH1D *hLoose[5]; //d0sig histogram of loose muons
   TH1D *hEff[5];   //loose2tight efficiency vs. d0sig 

   TH1D *hMWt[5];        //W transverse mass
   TH1D *hMTop[5];       //Top invariant mass
   TH1D *hMET[5];        //MET
   TH1D *hNJets[5];      //jet multiplicity
   TH1D *hNBjets25[5];   //# of b-jet > 25 GeV

   TH1D *hMTop_tight[5]; //Top invariant mass based on tight muon selection
   TH1D *hMTop_loose[5]; //Top invariant mass based on loose muon selection
   TH1D *hMTop_qcd[5];   //Top invariant mass - QCD estimation with both systematic and statistic error
   TH1D *hMTop_qcd_estat[5];   //Top invariant mass - QCD estimation with statistic error
   TH1D *hMTop_qcd_esyst[5];   //Top invariant mass - QCD estimation with systematic error

   TH1D *hMWt_tight[5];  //W transverse mass recalculated with tight muon selection
   TH1D *hMWt_loose[5];  //W transverse mass recalculated with loose muon selection
   TH1D *hMWt_qcd[5];    //W transverse mass - QCD estimation with both systematic and statistic error
   TH1D *hMWt_qcd_estat[5];    //W transverse mass - QCD estimation with statistic error
   TH1D *hMWt_qcd_esyst[5];    //W transverse mass - QCD estimation with systematic error

   TH1D *hMET_tight[5];  //MET based on tight selection
   TH1D *hMET_loose[5];  //MET based on loose selection
   TH1D *hMET_qcd[5];    //MET - QCD estimation with both systematic and statistic error
   TH1D *hMET_qcd_estat[5];    //MET - QCD estimation with statistic error
   TH1D *hMET_qcd_esyst[5];    //MET - QCD estimation with systematic error

   TH1D *hNJets_tight[5];  //jet multiplicity based on tight selection
   TH1D *hNJets_loose[5];  //jet multiplicity loose selection
   TH1D *hNJets_qcd[5];    //jet multiplicity - QCD estimation with both systematic and statistic error
   TH1D *hNJets_qcd_estat[5];    //jet multiplicity - QCD estimation with statistic error
   TH1D *hNJets_qcd_esyst[5];    //jet multiplicity - QCD estimation with systematic error

   TH1D *hNBjets25_tight[5];  //# of b-jet >25 GeV based on tight selection
   TH1D *hNBjets25_loose[5];  //# of b-jet >25 GeV loose selection
   TH1D *hNBjets25_qcd[5];    //# of b-jet >25 GeV - QCD estimation with both systematic and statistic error
   TH1D *hNBjets25_qcd_estat[5];    //# of b-jet >25 GeV - QCD estimation with statistic error
   TH1D *hNBjets25_qcd_esyst[5];    //# of b-jet >25 GeV - QCD estimation with systematic error

   TH1D *hNLoose[5]; // number of loose particles in the control regine
   TH1D *hNTight[5]; // number of tight particles in the control regine
   Int_t N_event;    // number of processed events

   int hist_array_size;
   int max_jet_multi;

   double d0_sig_t;

   Double_t h_scale;

   Bool_t is_mc;
   Bool_t is_mc_qcd;
   Bool_t is_mc_mix;
   Bool_t is_mc_ttbar;
   Bool_t is_mc_wjets;
   Bool_t is_mc_zjets;
   Bool_t is_data;

   TString sample;

   TString output_fname;

   // jet cut mode: {>=1, ==1, ==2, ==3, >=4}
   //TString jet_cut_strs[5];
   //Int_t   jet_cut_mode;

   Bool_t btagging_cut;
   Bool_t triangle_cut;

   TTree   *tree_eff_fake;    //tree object for storing fake efficiency calculated at runtime
   TBranch *b_d0sig_ctl;
   TBranch *b_num_jets;
   TBranch *b_num_mu_tight;
   TBranch *b_num_mu_loose;
   TBranch *b_eff_fake;
   TBranch *b_eff_fake_error;

   Double_t d0sig_ctl;        //d0sig control region
   Int_t    num_jets;         //number of jets
   Double_t num_mu_tight;     //number of tight muons
   Double_t num_mu_loose;     //number of loose muons
   Double_t eff_fake;         //fake efficiency
   Double_t eff_fake_error;   //fake efficiency error

   // Declaration of leaf types
   Double_t        LumiBlock;
   Double_t        MWtrans;
   Double_t        SV0_max_GoodJet;
   Double_t        mcevt_weight;
   Double_t        topMET_et;
   Double_t        topMET_eta;
   Double_t        topMET_etx;
   Double_t        topMET_ety;
   Double_t        topMET_phi;
   Double_t        topMass_GoodJet;
   Double_t        xsection;
   Int_t           BtagCut;
   Int_t           CleaningCut;
   Int_t           EF_e10_medium;
   Int_t           EF_e15_medium;
   Int_t           EF_e18_medium;
   Int_t           EF_e20_loose;
   Int_t           EF_e20_medium;
   Int_t           EF_g17_etcut;
   Int_t           EF_mu10_MSonly;
   Int_t           EF_mu13;
   Int_t           EF_mu13_tight;
   Int_t           EF_mu15_tight;
   Int_t           El_N;
   Int_t           EtMissCut;
   Int_t           EventNumber;
   Int_t           GoodEl_N;
   Int_t           GoodElectronCut;
   Int_t           GoodJet25_N;
   Int_t           GoodJet_N;
   Int_t           GoodLeptonCut;
   Int_t           LooseMu_N;
   Int_t           GoodMu_N;
   Int_t           GoodMuonCut;
   Int_t           HFORCut;
   Int_t           Jet20Cut;
   Int_t           Jet25Cut;
   Int_t           Jet_N;
   Int_t           L1_EM10;
   Int_t           L1_MU10;
   Int_t           Mu_N;
   Int_t           NBjets20;
   Int_t           NBjets25;
   Int_t           NonColBkgCut;
   Int_t           RunNumber;
   Int_t           TopObservationSelection_e;
   Int_t           TopObservationSelection_mu;
   Int_t           TriangularCut;
   Int_t           TriggerCut;
   Int_t           TriggerMatchCut;
   Int_t           el_n;
   Int_t           emuOverlapCut;
   Int_t           emuoverlap;
   Int_t           foundBadJets;
   Int_t           good_vxp;
   Int_t           grlevent;
   Int_t           jet_n;
   Int_t           lbn;
   Int_t           mu_n;
   vector<double>  *Jet_E;
   vector<double>  *Jet_SV0;
   vector<double>  *Jet_emscale_pt;
   vector<double>  *Jet_eta;
   vector<double>  *Jet_phi;
   vector<double>  *Jet_pt;
   vector<double>  *Jet_px;
   vector<double>  *Jet_py;
   vector<double>  *Jet_pz;
   vector<int>     *Jet_topJet_use;
   vector<double>  *GoodJet_E;
   vector<double>  *GoodJet_SV0;
   vector<double>  *GoodJet_emscale_pt;
   vector<double>  *GoodJet_eta;
   vector<double>  *GoodJet_phi;
   vector<double>  *GoodJet_pt;
   vector<double>  *GoodJet_px;
   vector<double>  *GoodJet_py;
   vector<double>  *GoodJet_pz;
   vector<int>     *GoodJet_topJet_use;
   vector<double>  *GoodJet25_E;
   vector<double>  *GoodJet25_SV0;
   vector<double>  *GoodJet25_emscale_pt;
   vector<double>  *GoodJet25_eta;
   vector<double>  *GoodJet25_phi;
   vector<double>  *GoodJet25_pt;
   vector<double>  *GoodJet25_px;
   vector<double>  *GoodJet25_py;
   vector<double>  *GoodJet25_pz;
   vector<int>     *GoodJet25_topJet_use;
   vector<double>  *GoodMu_E;
   vector<double>  *GoodMu_d0_exPV;
   vector<double>  *GoodMu_d0_sig_exPV;
   vector<double>  *GoodMu_d0_sigma_exPV;
   vector<double>  *GoodMu_dR_jet;
   vector<double>  *GoodMu_eta;
   vector<double>  *GoodMu_etcone30;
   vector<double>  *GoodMu_phi;
   vector<double>  *GoodMu_pt;
   vector<double>  *GoodMu_ptcone30;
   vector<double>  *GoodMu_px;
   vector<double>  *GoodMu_py;
   vector<double>  *GoodMu_pz;
   vector<double>  *GoodMu_trackphi;
   vector<double>  *GoodMu_tracktheta;
   vector<int>     *GoodMu_author;
   vector<int>     *GoodMu_tight;
   vector<int>     *GoodMu_isCosmic;
   vector<int>     *GoodMu_topMu_inTrigger;
   vector<int>     *GoodMu_topMu_use;
   vector<double>  *LooseMu_E;
   vector<double>  *LooseMu_d0_exPV;
   vector<double>  *LooseMu_d0_sig_exPV;
   vector<double>  *LooseMu_d0_sigma_exPV;
   vector<double>  *LooseMu_dR_jet;
   vector<double>  *LooseMu_eta;
   vector<double>  *LooseMu_etcone30;
   vector<double>  *LooseMu_phi;
   vector<double>  *LooseMu_pt;
   vector<double>  *LooseMu_ptcone30;
   vector<double>  *LooseMu_px;
   vector<double>  *LooseMu_py;
   vector<double>  *LooseMu_pz;
   vector<double>  *LooseMu_trackphi;
   vector<double>  *LooseMu_tracktheta;
   vector<int>     *LooseMu_author;
   vector<int>     *LooseMu_tight;
   vector<int>     *LooseMu_isCosmic;
   vector<double>  *GoodEl_E;
   vector<double>  *GoodEl_Et;
   vector<double>  *GoodEl_eta;
   vector<double>  *GoodEl_phi;
   vector<double>  *GoodEl_pt;
   vector<double>  *GoodEl_px;
   vector<double>  *GoodEl_py;
   vector<double>  *GoodEl_pz;
   vector<double>  *GoodEl_trackphi;
   vector<double>  *GoodEl_tracktheta;
   vector<int>     *GoodEl_topEl_inTrigger;
   vector<int>     *GoodEl_topEl_use;
   Float_t         weight;

   // List of branches
   TBranch        *b_LumiBlock;   //!
   TBranch        *b_MWtrans;   //!
   TBranch        *b_SV0_max_GoodJet;   //!
   TBranch        *b_mcevt_weight;   //!
   TBranch        *b_weight;   //!
   TBranch        *b_topMET_et;   //!
   TBranch        *b_topMET_eta;   //!
   TBranch        *b_topMET_etx;   //!
   TBranch        *b_topMET_ety;   //!
   TBranch        *b_topMET_phi;   //!
   TBranch        *b_topMass_GoodJet;   //!
   TBranch        *b_xsection;   //!
   TBranch        *b_BtagCut;   //!
   TBranch        *b_CleaningCut;   //!
   TBranch        *b_EF_e10_medium;   //!
   TBranch        *b_EF_e15_medium;   //!
   TBranch        *b_EF_e18_medium;   //!
   TBranch        *b_EF_e20_loose;   //!
   TBranch        *b_EF_e20_medium;   //!
   TBranch        *b_EF_g17_etcut;   //!
   TBranch        *b_EF_mu10_MSonly;   //!
   TBranch        *b_EF_mu13;   //!
   TBranch        *b_EF_mu13_tight;   //!
   TBranch        *b_EF_mu15_tight;   //!
   TBranch        *b_El_N;   //!
   TBranch        *b_EtMissCut;   //!
   TBranch        *b_EventNumber;   //!
   TBranch        *b_GoodEl_N;   //!
   TBranch        *b_GoodElectronCut;   //!
   TBranch        *b_GoodJet25_N;   //!
   TBranch        *b_GoodJet_N;   //!
   TBranch        *b_GoodLeptonCut;   //!
   TBranch        *b_LooseMu_N;   //!
   TBranch        *b_GoodMu_N;   //!
   TBranch        *b_GoodMuonCut;   //!
   TBranch        *b_HFORCut;   //!
   TBranch        *b_Jet20Cut;   //!
   TBranch        *b_Jet25Cut;   //!
   TBranch        *b_Jet_N;   //!
   TBranch        *b_L1_EM10;   //!
   TBranch        *b_L1_MU10;   //!
   TBranch        *b_Mu_N;   //!
   TBranch        *b_NBjets20;   //!
   TBranch        *b_NBjets25;   //!
   TBranch        *b_NonColBkgCut;   //!
   TBranch        *b_RunNumber;   //!
   TBranch        *b_TopObservationSelection_e;   //!
   TBranch        *b_TopObservationSelection_mu;   //!
   TBranch        *b_TriangularCut;   //!
   TBranch        *b_TriggerCut;   //!
   TBranch        *b_TriggerMatchCut;   //!
   TBranch        *b_el_n;   //!
   TBranch        *b_emuOverlapCut;   //!
   TBranch        *b_emuoverlap;   //!
   TBranch        *b_foundBadJets;   //!
   TBranch        *b_good_vxp;   //!
   TBranch        *b_grlevent;   //!
   TBranch        *b_jet_n;   //!
   TBranch        *b_lbn;   //!
   TBranch        *b_mu_n;   //!
   TBranch        *b_Jet_E;   //!
   TBranch        *b_Jet_SV0;   //!
   TBranch        *b_Jet_emscale_pt;   //!
   TBranch        *b_Jet_eta;   //!
   TBranch        *b_Jet_phi;   //!
   TBranch        *b_Jet_pt;   //!
   TBranch        *b_Jet_px;   //!
   TBranch        *b_Jet_py;   //!
   TBranch        *b_Jet_pz;   //!
   TBranch        *b_Jet_topJet_use;   //!
   TBranch        *b_GoodJet_E;   //!
   TBranch        *b_GoodJet_SV0;   //!
   TBranch        *b_GoodJet_emscale_pt;   //!
   TBranch        *b_GoodJet_eta;   //!
   TBranch        *b_GoodJet_phi;   //!
   TBranch        *b_GoodJet_pt;   //!
   TBranch        *b_GoodJet_px;   //!
   TBranch        *b_GoodJet_py;   //!
   TBranch        *b_GoodJet_pz;   //!
   TBranch        *b_GoodJet_topJet_use;   //!
   TBranch        *b_GoodJet25_E;   //!
   TBranch        *b_GoodJet25_SV0;   //!
   TBranch        *b_GoodJet25_emscale_pt;   //!
   TBranch        *b_GoodJet25_eta;   //!
   TBranch        *b_GoodJet25_phi;   //!
   TBranch        *b_GoodJet25_pt;   //!
   TBranch        *b_GoodJet25_px;   //!
   TBranch        *b_GoodJet25_py;   //!
   TBranch        *b_GoodJet25_pz;   //!
   TBranch        *b_GoodJet25_topJet_use;   //!
   TBranch        *b_GoodMu_E;   //!
   TBranch        *b_GoodMu_d0_exPV;   //!
   TBranch        *b_GoodMu_d0_sig_exPV;   //!
   TBranch        *b_GoodMu_d0_sigma_exPV;   //!
   TBranch        *b_GoodMu_dR_jet;   //!
   TBranch        *b_GoodMu_eta;   //!
   TBranch        *b_GoodMu_etcone30;   //!
   TBranch        *b_GoodMu_phi;   //!
   TBranch        *b_GoodMu_pt;   //!
   TBranch        *b_GoodMu_ptcone30;   //!
   TBranch        *b_GoodMu_px;   //!
   TBranch        *b_GoodMu_py;   //!
   TBranch        *b_GoodMu_pz;   //!
   TBranch        *b_GoodMu_trackphi;   //!
   TBranch        *b_GoodMu_tracktheta;   //!
   TBranch        *b_GoodMu_author;   //!
   TBranch        *b_GoodMu_tight;   //!
   TBranch        *b_GoodMu_isCosmic;   //!
   TBranch        *b_GoodMu_topMu_inTrigger;   //!
   TBranch        *b_GoodMu_topMu_use;   //!
   TBranch        *b_LooseMu_E;   //!
   TBranch        *b_LooseMu_d0_exPV;   //!
   TBranch        *b_LooseMu_d0_sig_exPV;   //!
   TBranch        *b_LooseMu_d0_sigma_exPV;   //!
   TBranch        *b_LooseMu_dR_jet;   //!
   TBranch        *b_LooseMu_eta;   //!
   TBranch        *b_LooseMu_etcone30;   //!
   TBranch        *b_LooseMu_phi;   //!
   TBranch        *b_LooseMu_pt;   //!
   TBranch        *b_LooseMu_ptcone30;   //!
   TBranch        *b_LooseMu_px;   //!
   TBranch        *b_LooseMu_py;   //!
   TBranch        *b_LooseMu_pz;   //!
   TBranch        *b_LooseMu_trackphi;   //!
   TBranch        *b_LooseMu_tracktheta;   //!
   TBranch        *b_LooseMu_author;   //!
   TBranch        *b_LooseMu_tight;   //!
   TBranch        *b_LooseMu_isCosmic;   //!
   TBranch        *b_GoodEl_E;   //!
   TBranch        *b_GoodEl_Et;   //!
   TBranch        *b_GoodEl_eta;   //!
   TBranch        *b_GoodEl_phi;   //!
   TBranch        *b_GoodEl_pt;   //!
   TBranch        *b_GoodEl_px;   //!
   TBranch        *b_GoodEl_py;   //!
   TBranch        *b_GoodEl_pz;   //!
   TBranch        *b_GoodEl_trackphi;   //!
   TBranch        *b_GoodEl_tracktheta;   //!
   TBranch        *b_GoodEl_topEl_inTrigger;   //!
   TBranch        *b_GoodEl_topEl_use;   //!

   dataselector(TTree * /*tree*/ =0) {

       //jet_cut_strs[0] = "1plus";
       //jet_cut_strs[1] = "1";
       //jet_cut_strs[2] = "2";
       //jet_cut_strs[3] = "3";
       //jet_cut_strs[4] = "4plus";

       SetDefaultOpts();
   }

   virtual ~dataselector() { }
   virtual void    SetDefaultOpts() { is_mc=kFALSE; is_mc_qcd=kFALSE; is_mc_mix=kFALSE; is_mc_ttbar=kFALSE; is_mc_wjets=kFALSE; is_mc_zjets=kFALSE; is_data=kTRUE; btagging_cut=kFALSE; triangle_cut=kFALSE; h_scale=1.; output_fname="qcd_analysis_hist.root"; hist_array_size = 5; max_jet_multi = hist_array_size-1;}
   virtual Int_t   Version() const { return 2; }
   virtual void    Begin(TTree *tree);
   virtual void    SlaveBegin(TTree *tree);
   virtual void    Init(TTree *tree);
   virtual Bool_t  Notify();
   virtual Bool_t  Process(Long64_t entry);
   virtual Int_t   GetEntry(Long64_t entry, Int_t getall = 0) { return fChain ? fChain->GetTree()->GetEntry(entry, getall) : 0; }
   virtual void    SetOption(const char *option) { fOption = option; }
   virtual void    SetObject(TObject *obj) { fObject = obj; }
   virtual Bool_t  ParseOptions(TString options);
   virtual void    SetInputList(TList *input) { fInput = input; }
   virtual TList  *GetOutputList() const { return fOutput; }
   virtual void    SlaveTerminate();
   virtual void    Terminate();

   virtual void    InitHistograms();
   virtual void    PackOutputList();
   virtual void    UnpackOutputList();
   virtual void    CleanOutputList();

   ClassDef(dataselector,0);
};

#endif

#ifdef dataselector_cxx
void dataselector::Init(TTree *tree)
{

   // The Init() function is called when the selector needs to initialize
   // a new tree or chain. Typically here the branch addresses and branch
   // pointers of the tree will be set.
   // It is normally not necessary to make changes to the generated
   // code, but the routine can be extended by the user if needed.
   // Init() will be called many times when running on PROOF
   // (once per file to be processed).

   // Set object pointer
   Jet_E = 0;
   Jet_SV0 = 0;
   Jet_emscale_pt = 0;
   Jet_eta = 0;
   Jet_phi = 0;
   Jet_pt = 0;
   Jet_px = 0;
   Jet_py = 0;
   Jet_pz = 0;
   Jet_topJet_use = 0;
   GoodJet_E = 0;
   GoodJet_SV0 = 0;
   GoodJet_emscale_pt = 0;
   GoodJet_eta = 0;
   GoodJet_phi = 0;
   GoodJet_pt = 0;
   GoodJet_px = 0;
   GoodJet_py = 0;
   GoodJet_pz = 0;
   GoodJet_topJet_use = 0;
   GoodJet25_E = 0;
   GoodJet25_SV0 = 0;
   GoodJet25_emscale_pt = 0;
   GoodJet25_eta = 0;
   GoodJet25_phi = 0;
   GoodJet25_pt = 0;
   GoodJet25_px = 0;
   GoodJet25_py = 0;
   GoodJet25_pz = 0;
   GoodJet25_topJet_use = 0;
   GoodMu_E = 0;
   GoodMu_d0_exPV = 0;
   GoodMu_d0_sig_exPV = 0;
   GoodMu_d0_sigma_exPV = 0;
   GoodMu_dR_jet = 0;
   GoodMu_eta = 0;
   GoodMu_etcone30 = 0;
   GoodMu_phi = 0;
   GoodMu_pt = 0;
   GoodMu_ptcone30 = 0;
   GoodMu_px = 0;
   GoodMu_py = 0;
   GoodMu_pz = 0;
   GoodMu_trackphi = 0;
   GoodMu_tracktheta = 0;
   GoodMu_author = 0;
   GoodMu_tight = 0;
   GoodMu_isCosmic = 0;
   GoodMu_topMu_inTrigger = 0;
   GoodMu_topMu_use = 0;
   LooseMu_E = 0;
   LooseMu_d0_exPV = 0;
   LooseMu_d0_sig_exPV = 0;
   LooseMu_d0_sigma_exPV = 0;
   LooseMu_dR_jet = 0;
   LooseMu_eta = 0;
   LooseMu_etcone30 = 0;
   LooseMu_phi = 0;
   LooseMu_pt = 0;
   LooseMu_ptcone30 = 0;
   LooseMu_px = 0;
   LooseMu_py = 0;
   LooseMu_pz = 0;
   LooseMu_trackphi = 0;
   LooseMu_tracktheta = 0;
   LooseMu_author = 0;
   LooseMu_tight = 0;
   LooseMu_isCosmic = 0;
   GoodEl_E = 0;
   GoodEl_Et = 0;
   GoodEl_eta = 0;
   GoodEl_phi = 0;
   GoodEl_pt = 0;
   GoodEl_px = 0;
   GoodEl_py = 0;
   GoodEl_pz = 0;
   GoodEl_trackphi = 0;
   GoodEl_tracktheta = 0;
   GoodEl_topEl_inTrigger = 0;
   GoodEl_topEl_use = 0;
   // Set branch addresses and branch pointers
   if (!tree) return;
   fChain = tree;
   fChain->SetMakeClass(1);

   fChain->SetBranchAddress("LumiBlock", &LumiBlock, &b_LumiBlock);
   fChain->SetBranchAddress("MWtrans", &MWtrans, &b_MWtrans);
   fChain->SetBranchAddress("SV0_max_GoodJet", &SV0_max_GoodJet, &b_SV0_max_GoodJet);
   fChain->SetBranchAddress("mcevt_weight", &mcevt_weight, &b_mcevt_weight);
   if ( is_mc ) fChain->SetBranchAddress("weight", &weight, &b_weight);
   fChain->SetBranchAddress("topMET_et", &topMET_et, &b_topMET_et);
   fChain->SetBranchAddress("topMET_eta", &topMET_eta, &b_topMET_eta);
   fChain->SetBranchAddress("topMET_etx", &topMET_etx, &b_topMET_etx);
   fChain->SetBranchAddress("topMET_ety", &topMET_ety, &b_topMET_ety);
   fChain->SetBranchAddress("topMET_phi", &topMET_phi, &b_topMET_phi);
   fChain->SetBranchAddress("topMass_GoodJet", &topMass_GoodJet, &b_topMass_GoodJet);
   fChain->SetBranchAddress("xsection", &xsection, &b_xsection);
   fChain->SetBranchAddress("BtagCut", &BtagCut, &b_BtagCut);
   fChain->SetBranchAddress("CleaningCut", &CleaningCut, &b_CleaningCut);
   fChain->SetBranchAddress("EF_e10_medium", &EF_e10_medium, &b_EF_e10_medium);
   fChain->SetBranchAddress("EF_e15_medium", &EF_e15_medium, &b_EF_e15_medium);
   fChain->SetBranchAddress("EF_e18_medium", &EF_e18_medium, &b_EF_e18_medium);
   fChain->SetBranchAddress("EF_e20_loose", &EF_e20_loose, &b_EF_e20_loose);
   fChain->SetBranchAddress("EF_e20_medium", &EF_e20_medium, &b_EF_e20_medium);
   fChain->SetBranchAddress("EF_g17_etcut", &EF_g17_etcut, &b_EF_g17_etcut);
   fChain->SetBranchAddress("EF_mu10_MSonly", &EF_mu10_MSonly, &b_EF_mu10_MSonly);
   fChain->SetBranchAddress("EF_mu13", &EF_mu13, &b_EF_mu13);
   fChain->SetBranchAddress("EF_mu13_tight", &EF_mu13_tight, &b_EF_mu13_tight);
   fChain->SetBranchAddress("EF_mu15_tight", &EF_mu15_tight, &b_EF_mu15_tight);
   fChain->SetBranchAddress("El_N", &El_N, &b_El_N);
   fChain->SetBranchAddress("EtMissCut", &EtMissCut, &b_EtMissCut);
   fChain->SetBranchAddress("EventNumber", &EventNumber, &b_EventNumber);
   fChain->SetBranchAddress("GoodEl_N", &GoodEl_N, &b_GoodEl_N);
   fChain->SetBranchAddress("GoodElectronCut", &GoodElectronCut, &b_GoodElectronCut);
   fChain->SetBranchAddress("GoodJet25_N", &GoodJet25_N, &b_GoodJet25_N);
   fChain->SetBranchAddress("GoodJet_N", &GoodJet_N, &b_GoodJet_N);
   fChain->SetBranchAddress("GoodLeptonCut", &GoodLeptonCut, &b_GoodLeptonCut);
   fChain->SetBranchAddress("LooseMu_N", &LooseMu_N, &b_LooseMu_N);
   fChain->SetBranchAddress("GoodMu_N", &GoodMu_N, &b_GoodMu_N);
   fChain->SetBranchAddress("GoodMuonCut", &GoodMuonCut, &b_GoodMuonCut);
   fChain->SetBranchAddress("HFORCut", &HFORCut, &b_HFORCut);
   fChain->SetBranchAddress("Jet20Cut", &Jet20Cut, &b_Jet20Cut);
   fChain->SetBranchAddress("Jet25Cut", &Jet25Cut, &b_Jet25Cut);
   fChain->SetBranchAddress("Jet_N", &Jet_N, &b_Jet_N);
   fChain->SetBranchAddress("L1_EM10", &L1_EM10, &b_L1_EM10);
   fChain->SetBranchAddress("L1_MU10", &L1_MU10, &b_L1_MU10);
   fChain->SetBranchAddress("Mu_N", &Mu_N, &b_Mu_N);
   fChain->SetBranchAddress("NBjets20", &NBjets20, &b_NBjets20);
   fChain->SetBranchAddress("NBjets25", &NBjets25, &b_NBjets25);
   fChain->SetBranchAddress("NonColBkgCut", &NonColBkgCut, &b_NonColBkgCut);
   fChain->SetBranchAddress("RunNumber", &RunNumber, &b_RunNumber);
   fChain->SetBranchAddress("TopObservationSelection_e", &TopObservationSelection_e, &b_TopObservationSelection_e);
   fChain->SetBranchAddress("TopObservationSelection_mu", &TopObservationSelection_mu, &b_TopObservationSelection_mu);
   fChain->SetBranchAddress("TriangularCut", &TriangularCut, &b_TriangularCut);
   fChain->SetBranchAddress("TriggerCut", &TriggerCut, &b_TriggerCut);
   fChain->SetBranchAddress("TriggerMatchCut", &TriggerMatchCut, &b_TriggerMatchCut);
   fChain->SetBranchAddress("el_n", &el_n, &b_el_n);
   fChain->SetBranchAddress("emuOverlapCut", &emuOverlapCut, &b_emuOverlapCut);
   fChain->SetBranchAddress("emuoverlap", &emuoverlap, &b_emuoverlap);
   fChain->SetBranchAddress("foundBadJets", &foundBadJets, &b_foundBadJets);
   fChain->SetBranchAddress("good_vxp", &good_vxp, &b_good_vxp);
   fChain->SetBranchAddress("grlevent", &grlevent, &b_grlevent);
   fChain->SetBranchAddress("jet_n", &jet_n, &b_jet_n);
   fChain->SetBranchAddress("lbn", &lbn, &b_lbn);
   fChain->SetBranchAddress("mu_n", &mu_n, &b_mu_n);
   fChain->SetBranchAddress("Jet_E", &Jet_E, &b_Jet_E);
   fChain->SetBranchAddress("Jet_SV0", &Jet_SV0, &b_Jet_SV0);
   fChain->SetBranchAddress("Jet_emscale_pt", &Jet_emscale_pt, &b_Jet_emscale_pt);
   fChain->SetBranchAddress("Jet_eta", &Jet_eta, &b_Jet_eta);
   fChain->SetBranchAddress("Jet_phi", &Jet_phi, &b_Jet_phi);
   fChain->SetBranchAddress("Jet_pt", &Jet_pt, &b_Jet_pt);
   fChain->SetBranchAddress("Jet_px", &Jet_px, &b_Jet_px);
   fChain->SetBranchAddress("Jet_py", &Jet_py, &b_Jet_py);
   fChain->SetBranchAddress("Jet_pz", &Jet_pz, &b_Jet_pz);
   fChain->SetBranchAddress("Jet_topJet_use", &Jet_topJet_use, &b_Jet_topJet_use);
   fChain->SetBranchAddress("GoodJet_E", &GoodJet_E, &b_GoodJet_E);
   fChain->SetBranchAddress("GoodJet_SV0", &GoodJet_SV0, &b_GoodJet_SV0);
   fChain->SetBranchAddress("GoodJet_emscale_pt", &GoodJet_emscale_pt, &b_GoodJet_emscale_pt);
   fChain->SetBranchAddress("GoodJet_eta", &GoodJet_eta, &b_GoodJet_eta);
   fChain->SetBranchAddress("GoodJet_phi", &GoodJet_phi, &b_GoodJet_phi);
   fChain->SetBranchAddress("GoodJet_pt", &GoodJet_pt, &b_GoodJet_pt);
   fChain->SetBranchAddress("GoodJet_px", &GoodJet_px, &b_GoodJet_px);
   fChain->SetBranchAddress("GoodJet_py", &GoodJet_py, &b_GoodJet_py);
   fChain->SetBranchAddress("GoodJet_pz", &GoodJet_pz, &b_GoodJet_pz);
   fChain->SetBranchAddress("GoodJet_topJet_use", &GoodJet_topJet_use, &b_GoodJet_topJet_use);
   fChain->SetBranchAddress("GoodJet25_E", &GoodJet25_E, &b_GoodJet25_E);
   fChain->SetBranchAddress("GoodJet25_SV0", &GoodJet25_SV0, &b_GoodJet25_SV0);
   fChain->SetBranchAddress("GoodJet25_emscale_pt", &GoodJet25_emscale_pt, &b_GoodJet25_emscale_pt);
   fChain->SetBranchAddress("GoodJet25_eta", &GoodJet25_eta, &b_GoodJet25_eta);
   fChain->SetBranchAddress("GoodJet25_phi", &GoodJet25_phi, &b_GoodJet25_phi);
   fChain->SetBranchAddress("GoodJet25_pt", &GoodJet25_pt, &b_GoodJet25_pt);
   fChain->SetBranchAddress("GoodJet25_px", &GoodJet25_px, &b_GoodJet25_px);
   fChain->SetBranchAddress("GoodJet25_py", &GoodJet25_py, &b_GoodJet25_py);
   fChain->SetBranchAddress("GoodJet25_pz", &GoodJet25_pz, &b_GoodJet25_pz);
   fChain->SetBranchAddress("GoodJet25_topJet_use", &GoodJet25_topJet_use, &b_GoodJet25_topJet_use);
   fChain->SetBranchAddress("GoodMu_E", &GoodMu_E, &b_GoodMu_E);
   fChain->SetBranchAddress("GoodMu_d0_exPV", &GoodMu_d0_exPV, &b_GoodMu_d0_exPV);
   fChain->SetBranchAddress("GoodMu_d0_sig_exPV", &GoodMu_d0_sig_exPV, &b_GoodMu_d0_sig_exPV);
   fChain->SetBranchAddress("GoodMu_d0_sigma_exPV", &GoodMu_d0_sigma_exPV, &b_GoodMu_d0_sigma_exPV);
   fChain->SetBranchAddress("GoodMu_dR_jet", &GoodMu_dR_jet, &b_GoodMu_dR_jet);
   fChain->SetBranchAddress("GoodMu_eta", &GoodMu_eta, &b_GoodMu_eta);
   fChain->SetBranchAddress("GoodMu_etcone30", &GoodMu_etcone30, &b_GoodMu_etcone30);
   fChain->SetBranchAddress("GoodMu_phi", &GoodMu_phi, &b_GoodMu_phi);
   fChain->SetBranchAddress("GoodMu_pt", &GoodMu_pt, &b_GoodMu_pt);
   fChain->SetBranchAddress("GoodMu_ptcone30", &GoodMu_ptcone30, &b_GoodMu_ptcone30);
   fChain->SetBranchAddress("GoodMu_px", &GoodMu_px, &b_GoodMu_px);
   fChain->SetBranchAddress("GoodMu_py", &GoodMu_py, &b_GoodMu_py);
   fChain->SetBranchAddress("GoodMu_pz", &GoodMu_pz, &b_GoodMu_pz);
   fChain->SetBranchAddress("GoodMu_trackphi", &GoodMu_trackphi, &b_GoodMu_trackphi);
   fChain->SetBranchAddress("GoodMu_tracktheta", &GoodMu_tracktheta, &b_GoodMu_tracktheta);
   fChain->SetBranchAddress("GoodMu_author", &GoodMu_author, &b_GoodMu_author);
   fChain->SetBranchAddress("GoodMu_tight", &GoodMu_tight, &b_GoodMu_tight);
   fChain->SetBranchAddress("GoodMu_isCosmic", &GoodMu_isCosmic, &b_GoodMu_isCosmic);
   fChain->SetBranchAddress("GoodMu_topMu_inTrigger", &GoodMu_topMu_inTrigger, &b_GoodMu_topMu_inTrigger);
   fChain->SetBranchAddress("GoodMu_topMu_use", &GoodMu_topMu_use, &b_GoodMu_topMu_use);
   fChain->SetBranchAddress("LooseMu_E", &LooseMu_E, &b_LooseMu_E);
   fChain->SetBranchAddress("LooseMu_d0_exPV", &LooseMu_d0_exPV, &b_LooseMu_d0_exPV);
   fChain->SetBranchAddress("LooseMu_d0_sig_exPV", &LooseMu_d0_sig_exPV, &b_LooseMu_d0_sig_exPV);
   fChain->SetBranchAddress("LooseMu_d0_sigma_exPV", &LooseMu_d0_sigma_exPV, &b_LooseMu_d0_sigma_exPV);
   fChain->SetBranchAddress("LooseMu_dR_jet", &LooseMu_dR_jet, &b_LooseMu_dR_jet);
   fChain->SetBranchAddress("LooseMu_eta", &LooseMu_eta, &b_LooseMu_eta);
   fChain->SetBranchAddress("LooseMu_etcone30", &LooseMu_etcone30, &b_LooseMu_etcone30);
   fChain->SetBranchAddress("LooseMu_phi", &LooseMu_phi, &b_LooseMu_phi);
   fChain->SetBranchAddress("LooseMu_pt", &LooseMu_pt, &b_LooseMu_pt);
   fChain->SetBranchAddress("LooseMu_ptcone30", &LooseMu_ptcone30, &b_LooseMu_ptcone30);
   fChain->SetBranchAddress("LooseMu_px", &LooseMu_px, &b_LooseMu_px);
   fChain->SetBranchAddress("LooseMu_py", &LooseMu_py, &b_LooseMu_py);
   fChain->SetBranchAddress("LooseMu_pz", &LooseMu_pz, &b_LooseMu_pz);
   fChain->SetBranchAddress("LooseMu_trackphi", &LooseMu_trackphi, &b_LooseMu_trackphi);
   fChain->SetBranchAddress("LooseMu_tracktheta", &LooseMu_tracktheta, &b_LooseMu_tracktheta);
   fChain->SetBranchAddress("LooseMu_author", &LooseMu_author, &b_LooseMu_author);
   fChain->SetBranchAddress("LooseMu_tight", &LooseMu_tight, &b_LooseMu_tight);
   fChain->SetBranchAddress("LooseMu_isCosmic", &LooseMu_isCosmic, &b_LooseMu_isCosmic);
   fChain->SetBranchAddress("GoodEl_E", &GoodEl_E, &b_GoodEl_E);
   fChain->SetBranchAddress("GoodEl_Et", &GoodEl_Et, &b_GoodEl_Et);
   fChain->SetBranchAddress("GoodEl_eta", &GoodEl_eta, &b_GoodEl_eta);
   fChain->SetBranchAddress("GoodEl_phi", &GoodEl_phi, &b_GoodEl_phi);
   fChain->SetBranchAddress("GoodEl_pt", &GoodEl_pt, &b_GoodEl_pt);
   fChain->SetBranchAddress("GoodEl_px", &GoodEl_px, &b_GoodEl_px);
   fChain->SetBranchAddress("GoodEl_py", &GoodEl_py, &b_GoodEl_py);
   fChain->SetBranchAddress("GoodEl_pz", &GoodEl_pz, &b_GoodEl_pz);
   fChain->SetBranchAddress("GoodEl_trackphi", &GoodEl_trackphi, &b_GoodEl_trackphi);
   fChain->SetBranchAddress("GoodEl_tracktheta", &GoodEl_tracktheta, &b_GoodEl_tracktheta);
   fChain->SetBranchAddress("GoodEl_topEl_inTrigger", &GoodEl_topEl_inTrigger, &b_GoodEl_topEl_inTrigger);
   fChain->SetBranchAddress("GoodEl_topEl_use", &GoodEl_topEl_use, &b_GoodEl_topEl_use);

   // make a clone of the original tree for storing the selected events
   //fChain->LoadTree(0);
   //fChainSelect = fChain->GetTree()->CloneTree(0);
   //fChainSelect->SetName(sample + "_stree");

}

Bool_t dataselector::Notify()
{
   // The Notify() function is called when a new file is opened. This
   // can be either for a new TTree in a TChain or when when a new TTree
   // is started when using PROOF. It is normally not necessary to make changes
   // to the generated code, but the routine can be extended by the
   // user if needed. The return value is currently not used.

   //cout << "new file opened" << endl;

   return kTRUE;
}

void dataselector::InitHistograms() {

   for (int j=0; j<hist_array_size; j++) {

      TString ht_ext = getHistNameExt(j);

      // histograms for Loose2Tight efficiency plots
      hTight[j] = new TH1D(sample + "_d0sig_tight" + ht_ext,"", 12, 0, 24.);
      hLoose[j] = new TH1D(sample + "_d0sig_loose" + ht_ext,"", 12, 0, 24.);

      // observables re-calculated with tight selection on muon
      hMWt_tight[j]      = new TH1D(sample + "_mwt_tight" + ht_ext  ,"", 30, 0., 150000.);
      hMWt_loose[j]      = new TH1D(sample + "_mwt_loose" + ht_ext  ,"", 30, 0., 150000.);
      hMTop_tight[j]     = new TH1D(sample + "_mtop_tight" + ht_ext ,"", 16, 50000., 450000.);
      hMTop_loose[j]     = new TH1D(sample + "_mtop_loose" + ht_ext ,"", 16, 50000., 450000.);
      hMET_tight[j]      = new TH1D(sample + "_met_tight" + ht_ext  ,"", 20, 0., 200000.);
      hMET_loose[j]      = new TH1D(sample + "_met_loose" + ht_ext  ,"", 20, 0., 200000.);
      hNJets_tight[j]    = new TH1D(sample + "_njets_tight" + ht_ext,"", 10 , 0, 10);
      hNJets_loose[j]    = new TH1D(sample + "_njets_loose" + ht_ext,"", 10 , 0, 10);
      hNBjets25_tight[j] = new TH1D(sample + "_nbjets25_tight" + ht_ext,"", 10 , 0, 10);
      hNBjets25_loose[j] = new TH1D(sample + "_nbjets25_loose" + ht_ext,"", 10 , 0, 10);

      // observables right in the Ntuple
      hMWt[j]      = new TH1D(sample + "_mwt" + ht_ext  ,"", 30, 0., 150000.);
      hMTop[j]     = new TH1D(sample + "_mtop" + ht_ext ,"", 16, 50000., 450000.);
      hMET[j]      = new TH1D(sample + "_met" + ht_ext  ,"", 20, 0., 200000.);
      hNJets[j]    = new TH1D(sample + "_njets" + ht_ext,"", 10, 0 , 10);
      hNBjets25[j] = new TH1D(sample + "_nbjets25" + ht_ext,"", 10, 0 , 10);

      hNLoose[j]   = new TH1D(sample + "_nloose" + ht_ext,"", 10, 0 , 10);
      hNTight[j]   = new TH1D(sample + "_ntight" + ht_ext,"", 10, 0 , 10);
   }
}

void dataselector::PackOutputList() {

   for (int j=0; j<hist_array_size; j++) {

      fOutput->Add(hTight[j]);
      fOutput->Add(hLoose[j]);

      // observables re-calculated with tight selection on muon
      fOutput->Add(hMWt_tight[j]);
      fOutput->Add(hMWt_loose[j]);  
      fOutput->Add(hMTop_tight[j]); 
      fOutput->Add(hMTop_loose[j]); 

      fOutput->Add(hMET_tight[j]);  
      fOutput->Add(hMET_loose[j]);  
      fOutput->Add(hNJets_tight[j]);
      fOutput->Add(hNJets_loose[j]);

      fOutput->Add(hNBjets25_tight[j]);
      fOutput->Add(hNBjets25_loose[j]);

      // observables right in the Ntuple
      fOutput->Add(hMWt[j]);
      fOutput->Add(hMTop[j]);
      fOutput->Add(hMET[j]);
      fOutput->Add(hNJets[j]);
      fOutput->Add(hNBjets25[j]);

      fOutput->Add(hNLoose[j]);
      fOutput->Add(hNTight[j]);
   }
}

void dataselector::UnpackOutputList() {

   TList *outputs = GetOutputList();

   Int_t idx = 0;

   //cout << "hist_array_size:  " << hist_array_size << endl;

   for (int j=0; j<hist_array_size; j++) {

      TString ht_ext = getHistNameExt(j);

      // histograms for Loose2Tight efficiency plots
      hTight[j] = dynamic_cast<TH1D*>( outputs->FindObject( sample + "_d0sig_tight" + ht_ext ) );
      hLoose[j] = dynamic_cast<TH1D*>( outputs->FindObject( sample + "_d0sig_loose" + ht_ext ) );

      // observables re-calculated with tight selection on muon
      hMWt_tight[j]      = dynamic_cast<TH1D*>( outputs->FindObject( sample + "_mwt_tight" + ht_ext ) );
      hMWt_loose[j]      = dynamic_cast<TH1D*>( outputs->FindObject( sample + "_mwt_loose" + ht_ext ) );
      hMTop_tight[j]     = dynamic_cast<TH1D*>( outputs->FindObject( sample + "_mtop_tight" + ht_ext ) );
      hMTop_loose[j]     = dynamic_cast<TH1D*>( outputs->FindObject( sample + "_mtop_loose" + ht_ext ) );
      hMET_tight[j]      = dynamic_cast<TH1D*>( outputs->FindObject( sample + "_met_tight" + ht_ext ) );
      hMET_loose[j]      = dynamic_cast<TH1D*>( outputs->FindObject( sample + "_met_loose" + ht_ext ) );
      hNJets_tight[j]    = dynamic_cast<TH1D*>( outputs->FindObject( sample + "_njets_tight" + ht_ext ) );
      hNJets_loose[j]    = dynamic_cast<TH1D*>( outputs->FindObject( sample + "_njets_loose" + ht_ext ) );
      hNBjets25_tight[j] = dynamic_cast<TH1D*>( outputs->FindObject( sample + "_nbjets25_tight" + ht_ext ) ); 
      hNBjets25_loose[j] = dynamic_cast<TH1D*>( outputs->FindObject( sample + "_nbjets25_loose" + ht_ext ) ); 

      // observables right in the Ntuple
      hMWt[j]      = dynamic_cast<TH1D*>( outputs->FindObject( sample + "_mwt" + ht_ext ) );
      hMTop[j]     = dynamic_cast<TH1D*>( outputs->FindObject( sample + "_mtop" + ht_ext ) );
      hMET[j]      = dynamic_cast<TH1D*>( outputs->FindObject( sample + "_met" + ht_ext ) );
      hNJets[j]    = dynamic_cast<TH1D*>( outputs->FindObject( sample + "_njets" + ht_ext ) );
      hNBjets25[j] = dynamic_cast<TH1D*>( outputs->FindObject( sample + "_nbjets25" + ht_ext ) );

      hNLoose[j]   = dynamic_cast<TH1D*>( outputs->FindObject( sample + "_nloose" + ht_ext ) );
      hNTight[j]   = dynamic_cast<TH1D*>( outputs->FindObject( sample + "_ntight" + ht_ext ) );
   }
}

void dataselector::CleanOutputList() {
   TList *outputs = GetOutputList();
   outputs->Clear("nodelete");
}

Bool_t dataselector::ParseOptions(TString options) {

    TObjArray *opts = options.Tokenize(" ");

    for (int i=0; i < opts->GetEntries(); i++) {

        TObjArray *opt = ((TObjString *) opts->At(i))->GetString().Tokenize("=");
        TString    key = "";
        TString    val = "";

        if ( opt->GetEntries() == 0 ) continue;

        key = ((TObjString *) opt->At(0))->GetString();
        key.ToLower();

        if ( opt->GetEntries() == 2 ) {
            val = ((TObjString *) opt->At(1))->GetString();
            val.ToLower();
        }

        // determing the sample name to apply different cut
        if ( key.Contains("sample") ) {

            is_mc_qcd   = kFALSE;
            is_mc_mix   = kFALSE;
            is_mc_ttbar = kFALSE;
            is_mc_wjets = kFALSE;
            is_mc_zjets = kFALSE;

            if ( val.BeginsWith("mc") ) {
                is_mc   = kTRUE;
                is_data = kFALSE;
                if (! val.CompareTo("mc_qcd"))   is_mc_qcd = kTRUE;
                if (! val.CompareTo("mc_mix"))   is_mc_mix = kTRUE;
                if (! val.CompareTo("mc_ttbar")) is_mc_ttbar = kTRUE;
                if (! val.CompareTo("mc_wjets")) is_mc_wjets = kTRUE;
                if (! val.CompareTo("mc_zjets")) is_mc_zjets = kTRUE;
            }
            else if ( val.BeginsWith("data10") ) {
                is_mc   = kFALSE;
                is_data = kTRUE;
            }
            else {
                cout << "unknown sample: " << val << endl;
                return kFALSE;
            }

            sample = val;

            continue;
        }

        // turnning on/off btagging cut 
        if ( key.Contains("cbtagging") ) {
            btagging_cut = kTRUE;            
            continue;
        }

        // turnning on/off triangle cut 
        if ( key.Contains("ctriangle") ) {
            triangle_cut = kTRUE;            
            continue;
        }

        // jet multiplicity ( <1: >=1 jets, 1: 1 jet, 2: 2 jets, 3: 3 jets, >=4: >= 4 jets)
        /* if ( key.Contains("njets") ) {

            jet_cut_mode = val.Atoi();
   
            if ( jet_cut_mode < 0 ) jet_cut_mode = 0;
            if ( jet_cut_mode > 4 ) jet_cut_mode = 4;

            continue;
        } */

        // d0sig  threshold
        if ( key.Contains("d0sig") ) {
            d0_sig_t = val.Atof();
            continue;
        }

        // histogram scaling factor 
        if ( key.Contains("hscale") ) {
            h_scale = val.Atof();
            continue;
        }

        // output file  
        if ( key.Contains("output") ) {
            output_fname = val;
            continue;
        }
    }

    // print runtime options
    cout << "=============== Sample =============="<< endl;
    cout << "data     sample   : " << is_data      << endl;
    cout << "mc       sample   : " << is_mc        << endl;
    cout << "mc  qcd  sample   : " << is_mc_qcd    << endl;
    cout << "mc  mix  sample   : " << is_mc_mix    << endl;
    cout << "mc ttbar sample   : " << is_mc_ttbar  << endl;
    cout << "mc wjets sample   : " << is_mc_wjets  << endl;
    cout << "mc zjets sample   : " << is_mc_zjets  << endl;
    cout << "========== Event Selection =========="<< endl;
    cout << "cut btagging      : " << btagging_cut << endl;
    cout << "cut triangle      : " << triangle_cut << endl;
    cout << "========== Control Region  =========="<< endl;
    cout << "d0 significance   : " << d0_sig_t     << endl;
    cout << "============== Scaling =============="<< endl;
    cout << "histogram scale   : " << h_scale      << endl;

    return kTRUE;
}

#endif // #ifdef dataselector_cxx
